package fr.upmc.i3s.upmcontact.contents;

import java.util.Date;

public class Submitted extends Content {
	
	private static final long serialVersionUID = -6464376325016704905L;
	
	private String description;
	private String place;
	private String photoPath;
	private User signaledBy;
	
	public Submitted() {
		super();
		this.description = null;
		this.place = null;
		this.photoPath = null;
		this.signaledBy = null;
	}

	public Submitted(String id, Date createdAt, Date updatedAt, 
			 			String description, String place, String photoPath, User signaledBy) {
		super(id, createdAt, updatedAt);
		this.description = description;
		this.place = place;
		this.photoPath = photoPath;
		this.signaledBy = signaledBy;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getPlace() {
		return place;
	}

	public void setPlace(String place) {
		this.place = place;
	}

	public String getPhotoPath() {
		return photoPath;
	}

	public void setPhotoPath(String photoPath) {
		this.photoPath = photoPath;
	}

	public User getSignaledBy() {
		return signaledBy;
	}

	public void setSignaledBy(User signaledBy) {
		this.signaledBy = signaledBy;
	}
	
	@Override
	public int hashCode() {
		return super.hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		Submitted other = (Submitted) obj;
		if (description == null) {
			if (other.description != null)
				return false;
		} else if (!description.equals(other.description))
			return false;
		if (photoPath == null) {
			if (other.photoPath != null)
				return false;
		} else if (!photoPath.equals(other.photoPath))
			return false;
		if (place == null) {
			if (other.place != null)
				return false;
		} else if (!place.equals(other.place))
			return false;
		if (signaledBy == null) {
			if (other.signaledBy != null)
				return false;
		} else if (!signaledBy.equals(other.signaledBy))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return super.toString() + " Submitted [description=" + description + ", place=" + place
				+ ", photoPath=" + photoPath + ", signaledBy=" + signaledBy
				+ "]";
	}
	
}